package models

import "gorm.io/gorm"

type Article struct {
	gorm.Model
	Draft        bool   `gorm:"not null" json:"draft"`
	Title        string `gorm:"type:varchar(255);not null" json:"title"`
	Content      string `gorm:"type:text;not null" json:"content"`
	AuthorID     uint   `gorm:"not null" json:"author_id"`
	ChannelId    uint   `gorm:"not null" json:"channel_id"`
	CoverId      uint   `gorm:"not null" json:"cover_id"`
	ReadCount    uint   `gorm:"not null" json:"read_count"`
	CommentCount uint   `gorm:"not null" json:"comment_count"`
	LikeCount    uint   `gorm:"not null" json:"like_count"`
	StarCount    uint   `gorm:"not null" json:"star_count"`
}

type Cover struct {
	gorm.Model
	Type     int    `gorm:"type:int;not null" json:"type"`
	ImageURL string `gorm:"type:varchar(2000);not null" json:"image_url"`
}
